<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */
 
 //update account info
 if(isset($_POST['change-info']))
{
	$mess=false;
	$op=false;
	$arr=array();
	$strBirthday=$_POST['txtBirthday'];
	$strSexType=$_POST['txtSexType'];
	$strAdd=$_POST['txtAddress'];
	$strPhone=$_POST['txtPhone'];
	
	
	update_usermeta($current_user->data->ID, 'birthday', $strBirthday );
	update_usermeta($current_user->data->ID, 'sex_type', $strSexType );
	update_usermeta($current_user->data->ID, 'address', $strAdd );
	update_usermeta($current_user->data->ID, 'phone', $strPhone );
	//array_push($arr,$lag);$lag="Khách hàng vui lòng điền đầy đủ thông tin";

}




global $post;
get_header(); 

// $arrGoodsInfo = new stdclass();
$arrGoodsInfo = new stdClass();
if(isset($_POST['add_to_cart'])){ 
	$arrGoodsInfo->goods_id = $_POST["goods_id"];
	$arrGoodsInfo->qty = 1;
	
// var_dump($arrGoodsInfo);
// var_dump($_POST["post_id"]);
// return;
    $result = add_to_order_cart($arrGoodsInfo);
    wp_redirect(get_permalink(get_page_id("order-cart")));
}

//var_dump($_SESSION["order_cart"]);

?>
    <div class="row-fluid">
        <div id="primary" class="site-content span12">   
            <?php woo_main_before();?>
    		<div id="content" role="main">
                
                <header id="product-title" class="cart-title">
                    <h2 class="fl pom2">Thay đổi thông tin tài khoản</h2>					
                    <h3 class="pom3">Xin chào <?php echo $current_user->data->display_name ?></h3>
					<p class="oipi3">Từ mục "TÀI KHOẢN CỦA TÔI" ....</p>
				</header>
				
				<form class="form-horizontal" id="" name="change-account-info" action="" method="post">
						
					<div class="control-group">
						<label class="control-label" for="inputPassword">Ngày sinh</label>
						<input class="" name="txtBirthday"value="<?php echo get_the_author_meta('birthday',$current_user->data->ID)?>"> </input>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputPassword">Giới tính</label>
						<input class="fild uis" name="txtSexType" class="" value="<?php echo get_the_author_meta('sex_type',$current_user->data->ID)?>"> </input>
					</div>
					
					<div class="control-group">	
						<button name="change-info" type="submit" class="btn btn-primary btn-lg" >
					  Thay đổi aaaa
					</button></div>
					
				</form>
				aaaaa
				
				
    		</div><!-- #content -->            
            <?php woo_main_after();?>
    	</div><!-- #primary -->        
    </div>
	



<?php get_footer(); ?>

